<template>
  <div>
    <button @click="handleClick">原生按钮</button>
    <br>
    <!-- 点击子组件的按钮既触发子组件也触发父组件 -->
    <test-component @click.native="handleClick" />
    <!-- 只能触发子组件 -->
    <!-- <testComponent /> -->

  </div>
</template>

<script>
import testComponent from '@/components/testComponent'
export default {
  components: {
    testComponent
  },
  methods: {
    handleClick() {
      console.log('父组件触发了点击')
    }
  }
}
</script>

<style>

</style>
